Router device and routing method

ABSTRACT

A routing device includes a memory for storing routing entries in a routing table and a cache memory for storing some of routing entries present in the memory together with information of a mask length of a destination address as a cache entry. A high-speed retrieval section retrieves the cache entry corresponding to the destination address as referencing the cache memory based on the destination address of an input packet. An ordinary retrieval section retrieves the routing entry corresponding to the destination address as referencing the memory. A caching processing section writes the cache entry into the cache memory based on the routing entry retrieved by the ordinary retrieval section. The router device enables routing without using a routing entry that should not be used in the routing originally even when part of the routing table is cached as well as suppressing usage quantity of the cache entries to improve their usage efficiency.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to a router device and routingmethod for routing a packet via an IP (Internet Protocol) network byusing cache entries in a cache memory corresponding to some of routingentries in a routing table that includes routing information relating adestination IP address of the packet to a routing path such as next hopor adjacent router connected to the router device.

[0003] 2. Description of the Related Art

[0004] Conventionally, there has been one method available forperforming a routing processing by using the exclusive hardware in orderto produce a high-speed router device. In the method, the router devicehas large routing tables, so that the exclusive hardware needs to beconfigured to be of a mass capacity in order to store all of the routingtables in its limited storage capacity, thereby becoming very expensive.

[0005] In relation to the above conventional method, such aconfiguration has been employed that software thereof holds all of therouting tables in order to produce not only a high-speed but alsoinexpensive router device. In the configuration, the router devicecaches routing entries of some of these routing tables that have a highusage frequency into the dedicated hardware. The routing tables of thesoftware may be searched if information of interest cannot be obtainedupon retrieval by the dedicated hardware.

[0006] The above conventional technologies, however, has the followingproblems. The above method of searching the routing tables is based on acharacteristic of a longest prefix match principle (hereinafter referredto as “longest match”). In the longest match, it is necessary to employa routing entry having a higher priority from the routing entries thathave a plurality of matched conditions, that is, to employ such arouting entry so as to have a long network address mask.

[0007] There is available a CAM (Content-Addressable Memory) that canperform such a longest match and is provided with a three-valuedretrieval capability. However, the CAM is expensive and has a smallcapacity, so that taking into account problems, to be solved, of a largepower dissipation and a large mounting area on a board at the time ofmounting. Accordingly, it becomes preferable to use hardware having aninexpensive and general-purpose full-match retrieval capability in orderto construct a small and inexpensive device.

[0008] Further, if one routing entry present in the routing table is tobe cached in a case where such a CAM is used, there occurs a possibilitythat routing may be performed mistakenly using this cached routingentry. Because those routing entries that have a higher priority thanthis cached routing entry are not cached.

[0009] To prevent this, it becomes necessary to simultaneously cacheinto the CAM all of the related routing entries having a higher prioritythan the cached routing entry. Consequently, the CAM cannot be used in anetwork having a larger number of routing tables than the number of thecache entries.

[0010] For example, in a router device provided with a default gatewayand 100 routing entries, it becomes necessary to cache all of the 100routing entries in order to cache the default gateway.

[0011] The routing table, therefore, is cached, in a popular manner, toa destination IP address of a processed packet, in which case, however,the cache entries are not masked. Therefore, if communication to aplurality of destination IP addresses routed using the same routingentry is cached, such an event may happen that the same number of cacheentries as the number of these destination IP addresses are created.

[0012] In such a case, an originally small storage capacity of thededicated hardware is decreased and, at the same time, a retrieval-hitratio is not improved to thus increase a write frequency and decrease acache-usage efficiency, thereby degrading a throughput.

SUMMARY OF THE INVENTION

[0013] Therefore, it is an object of the present invention to enablerouting without using a routing entry that should not be used in therouting originally even when part of a routing table is cached as wellas suppressing usage quantity of the cache entries to improve theirusage efficiency.

[0014] To solve the problems, the present invention has been developedand provides A router device for routing a packet based on itsdestination address, comprising: a routing table for storing routingentries including routing information relating the destination addressof the packet to a routing path; a cache memory for storing some ofrouting entries in the routing table together with mask-lengthinformation of the destination address as a cache entry; a firstretrieval section for retrieving the cache entry which corresponds tothe destination address of the packet by making reference to the cachememory based on the destination address; a second retrieval section forretrieving the routing entry which corresponds to the destinationaddress by making reference to the routing table; a storage section forstoring the routing entry retrieved by the second retrieval sectiontogether with the mask-length information of the destination address asthe cache entry in the cache memory; and an output section foroutputting a retrieval result sent from the first or second retrievalsection.

[0015] That is, the present invention speeds up routing processing bycaching into the high-speed cache memory the routing entry having a highreference frequency present in the routing table that features a longestmatch of, for example, an IP address. Further, IP address information isregistered together with the mask-length information of the IP addressin the cache table, so that if there is the routing entry that has apossibility of a longer match, all of the related entries are registeredin the cache table to retrieve the cache entry, recognizing presence ofthe plurality of entries which are related in realization of the longestmatch.

[0016] Specifically, the process sequentially retrieves the routingentries starting from the one having a smaller mask length to performlongest match processing. Further, the process creates a virtual routingentry not present in the actual routing table, thereby solving apriority problem in the longest match when performing partial caching.

[0017] The present invention attempts to thus reduce the number of theentries in the cache memory to a minimum required value, therebyreducing an entry retrieval time and improving a usage efficiency of thecache memory.

BRIEF DESCRIPTION OF THE DRAWINGS

[0018]FIG. 1 is a functional block diagram for showing a schematicinternal configuration of a router device according to an embodiment ofthe present invention;

[0019]FIG. 2 is functional block diagram for showing a schematicinternal configuration of a cache retrieval-processing section;

[0020]FIG. 3 is functional block diagram for showing a schematicinternal configuration of a routing table retrieval processing section;

[0021]FIG. 4 is functional block diagram for showing a schematicinternal configuration of a cache management-processing section 32;

[0022]FIG. 5 is a flowchart for showing operations of a high-speedretrieval section 1 of FIG. 1;

[0023]FIG. 6 is a flowchart for showing operations of an ordinaryretrieval section 2 of FIG. 1;

[0024]FIG. 7 is a flowchart for showing operations of a cache managementsection 3 of FIG. 1; and

[0025]FIG. 8 is another flowchart for showing the operations of thecache management section 3 of FIG. 1.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0026] The following will describe embodiments of the present inventionwith reference to drawings.

[0027] [Explanation of Configuration]

[0028]FIG. 1 is a functional block diagram showing a schematic internalconfiguration of a router device according to an embodiment of thepresent invention. In the embodiment, a router device 100 is connectedto a network such as a local area network (LAN) 101. This device 100 isalso connected to a plurality of two adjacent routers R1 and R2 eachconnected to the networks N1 and N2 such as a LAN respectively. In thedevice 100, an packet is input from the network 100 or any one of theadjacent routers R1 and R2, and then a routing path (next hop oradjacent router) of the packet is selected by searching entries in acache memory or a routing table according to a destination IP address ofthe packet, whereby the packet is output to the network 100, the routersR1 or R2 corresponding to the selected routing path.

[0029] In FIG. 1, the router device 100 functionally includes ahigh-speed retrieval section 1, an ordinary retrieval section 2connected to the section 1, and a cache management section 3 connectedto the sections 1 and 2. The high-speed retrieval section 1 is a firstretrieval section for performing search by using a cache memory. Theordinary retrieval section 2 is a second retrieval section for searchinga routing table that has not been able to be searched in the cachememory. The cache management section 3 is configured to manage a stateof the cache memory.

[0030] In FIG. 1, the device 100 has also an interface section 4including an input interface and an output interface connected to thesection 1 and 2, and a controller 5 connected to the sections 1 to 4.The interface section 4 is also connected to the network 100 and twoadjacent routers R1 and R2. The controller 5 controls operations of thesections 1 to 4.

[0031] The high-speed retrieval section 1 comprises a routing entrystorage cache memory (cache memory) 12 and a cache retrieval-processingsection 11.

[0032] The cache memory 12 stores some of routing entries present in arouting table 22 of the ordinary retrieval section 2.

[0033] The cache retrieval-processing section 11 performs retrievalprocessing on the cache memory 12 in response to a retrieval request fora destination IP address of an input packet, to output a retrievalresult or make a retrieval request to the ordinary retrieval section 2depending on a result of the retrieval processing.

[0034]FIG. 2 is functional block diagram for showing a schematicinternal configuration of the cache retrieval-processing section 11.

[0035] In FIG. 2, the cache retrieval-processing section 11 functionallyincludes a destination address take-out section 111, a network addressmask length extraction section 112, an address creation section 113, acache entry search section 114, a decision section 115, and a promptingsection 116.

[0036] The take-out section 111 takes out a destination address such asa destination IP address of a packet input to the interface 4.

[0037] The extraction section 112 extracts a network address mask lengthin the cache memory 12.

[0038] The creation section 113 creates an address by an AND operationbetween the destination address taken out by the take-out section 111and a minimum network address mask length extracted by the extractionsection 112.

[0039] The cache entry search section 114 searches the cache memory 12for a cache entry as considering an address created by the creationsection 113 to be a virtual network address.

[0040] The decision section 115 decides whether a cache entry, if foundin the cache memory 12 as a result of search by the search section 115,is a link entry constituted of an entry group to which the cache entryrelates.

[0041] The prompting section 116 prompts the extraction section to takeout a network address mask length larger than a network address masklength extracted earlier until the decision section decides that thecache entry once decided to be the link entry as a result of decision bythe decision section is not a link entry.

[0042] The ordinary retrieval section 2 comprises a routing tablestorage memory (memory) 22, a routing table retrieval processing section21, and a caching processing section 23.

[0043] The memory 22 has a routing table for storing routing cachesincluding routing information relating a destination IP address of aninput packet to a routing path (next hop or router).

[0044] The routing table retrieval processing section 21 performsretrieval in the memory 22 in response to a retrieval request sent fromthe high-speed retrieval section 1, to output a retrieval result.

[0045] The caching processing section 23 stores the retrieval resultfrom the routing table retrieval processing section 21 into the cachememory 12.

[0046]FIG. 3 is functional block diagram for showing a schematicinternal configuration of the routing table retrieval processing section21.

[0047] In FIG. 3, the routing table retrieval processing section 21functionally comprises a destination address take-out section 211, annetwork address mask length extraction section 212, an address creationsection 213, a routing entry search section 214, a network address masklength search section 215, a link entry creation section 216, aprompting section 217, and a final cache entry creation section 218.

[0048] The take-out section 211 takes out a destination address of apacket inputted to the interface 4.

[0049] The extraction section 212 extracts a network address mask lengthfrom the memory 22.

[0050] The address creation section 213 creates an address by an ANDoperation between a destination address taken out by the take-outsection 211 and a network address mask length extracted by theextraction section 212.

[0051] The routing entry search section 214 searches the memory 22 for arouting entry that indicates an address created by the address creationsection 213.

[0052] The network address mask length search section 215 searches thememory 22 for a minimum network address mask length of those larger thana network address mask length extracted earlier by the extractionsection 212, from a routing entry group contained in an address createdby the address creation section 213.

[0053] The link entry creation section 216 creates a link entry ifresults of searching by the search sections 214 and 215 indicate thatthe routing entry is not present and the minimum network address masklength is present.

[0054] The prompting section 217 prompts the extraction section to takeout a network address mask length larger than a network address masklength extracted earlier after a linking cache entry is created by thelink entry creation section 216 if the results of searching by thesearch sections 214 and 215 indicate that the routing entry and theminimum network address mask length are present.

[0055] The final cache entry creation section 218 creates a final cacheentry that stores information necessary for routing if the results ofsearching by the search sections 214 and 215 indicate that neither therouting entry nor the minimum network address mask length is present.

[0056] The cache management section 3 functionally comprises a routingtable management-processing section 31, a cache management-processingsection 32, and a cache monitoring timer processing section 33.

[0057] The routing table management-processing section 31 processes arouting table update request sent from a routing protocol to update thememory 22 and post an update result to the cache management-processingsection 32.

[0058] The cache management-processing section 32 manages a state of thecache memory 12 based on a post from the routing tablemanagement-processing section 31, to update contents of the cache memory12 if necessary.

[0059] The cache monitoring timer processing section 33 deletes a cacheentry having a low usage frequency as monitoring the cache entries inthe cache memory 12.

[0060]FIG. 4 is functional block diagram for showing a schematicinternal configuration of the cache management-processing section 32.

[0061] In FIG. 4, the cache management-processing section 32functionally comprises a network address mask length take-out section321, a cache entry search section 322, a first decision section 323, asecond decision section 324, a first update section 325, a thirddecision section 326, and a second update section 327.

[0062] The network address mask length take-out section 321 takes out anetwork address mask length of a network address of a routing entry ifthe routing entry is added to the memory 22.

[0063] The cache entry search section 322 searches for a cache entryhaving a maximum mask length of the cache entries containing the networkaddress.

[0064] The first decision section 323 decides whether a cache entry, iffound as a result of searching by the search section 322, indicates linkprocessing.

[0065] The second decision section 324 decides whether a next networkaddress mask length used in the link processing indicated by the cacheentry is smaller than an added network address mask length, if a resultof decision by the first decision section 323 indicates that the cacheentry indicates the link processing.

[0066] The first update section 325 updates the network address masklength to a next network address mask length used in the link processingin the cache entry, if the result of decision by the first decisionsection indicates that the cache entry does not indicate the linkprocessing or if a result of decision by the second decision section 324indicates that the next network address mask length used in the linkprocessing indicated by the cache entry is larger than the added networkaddress mask length.

[0067] The third decision section 326 decides whether a minimum networkaddress mask length is less than a network address mask length of anadded routing entry, if the cache entry is not found as a result ofsearching by the cache entry search section 322.

[0068] The second update section 327 updates the minimum network addressmask length to the network address mask length of the added routingentry, if a result of decision by the third decision section indicatesthat the minimum network address mask length is less than the networkaddress mask length of the added routing entry.

[0069] [Explanation of Operations]

[0070] The following will describe operations of a router shown inFIG. 1. FIG. 5 is a flowchart showing operations of the high-speedretrieval section 1 of FIG. 1.

[0071] First, the cache retrieval-processing section 11 takes out adestination IP address D of a packet input to the router device (stepS1). Then, the cache retrieval-processing section 11 takes out a minimumnetwork address mask length Mm from a routing table provided to thedevice and stores it as a network address mask length Mc (step S2).

[0072] Then, the cache retrieval-processing section 11 creates an IPaddress Nc by an AND operation between the destination IP address D andthe network address mask length Mc (step S3). The cacheretrieval-processing section 11 then searches the cache memory 12 forentries as considering the IP address Nc to be a virtual network address(step S4).

[0073] The cache retrieval-processing section 11 decides whether anycache entry is found as a result of searching the cache memory 12 forthe cache entries (step S5). If no cache entry is found as a result ofdecision, cache retrieval processing is ended, to cause the ordinaryretrieval section 2 to continue the processing. If a cache entry isfound as a result of decision, on the other hand, the cacheretrieval-processing section 11 further decides whether the cache entryis a link entry (step S6).

[0074] If a result of decision indicates that the cache entry is not alink entry, the cache retrieval-processing section 11 decides that acache entry of interest is present in the cache memory 12, endsretrieval processing, and outputs contents of the cache entry as aretrieval result.

[0075] If, on the other hand, the result of decision indicates that thefound cache entry is a link entry, which means that a network having amask length larger than the mask length Mc of the current networkaddress is present in the routing table, the cache retrieval-processingsection 11 takes out a new network address mask length from the linkentry, to update Mc (step S7). Then, the process returns to step S3.

[0076]FIG. 6 is a flowchart showing operations of the ordinary retrievalsection 2 of FIG. 1.

[0077] First, the routing table retrieval-processing section 21 receivesthe destination IP address D that has not been matched in caching at thecache retrieval-processing section 11, to retrieve a routing entry ofthe memory 22 by using a typical routing table retrieval algorithm.

[0078] A routing entry, if found as a result of retrieval, is passedtogether with the destination IP address D to the caching processingsection 23. The caching processing section 23 acquires the destinationIP address D from the routing table retrieval-processing section 21(step W1).

[0079] Next, the routing table retrieval-processing section 21 takes outthe minimum network address mask length Mc from the memory 22 (step W2).Next, the routing retrieval-processing section 21 creates the IP addressNc by an AND operation between the destination IP address D and thenetwork address mask length Mc (step W3).

[0080] Then, the routing table retrieval-processing section 21 searches,as considering the IP address Nc to be a virtual network address, thememory 22 for a minimum mask length Mn larger than the minimum networkaddress mask length Mc from a routing entry group contained in the IPaddress Nc (step W4).

[0081] The routing table retrieval-processing section 21 decides whetherthe minimum mask length Mn larger than the minimum network address masklength Mc is found as a result of searching the memory 22 (step W5).

[0082] If a result of decision indicates that the minimum mask length Mnis present larger than the minimum network address mask length Mc, acache entry indicating the IP address Nc is searched for (step W6).

[0083] The process then decides whether a cache entry indicating the IPaddress Nc is present (step W7).

[0084] If a result of decision indicates that no entry indicating the IPaddress Nc is present, the process creates a link entry indicating theIP address Nc that newly stores the mask length Mn to be retrieved next(step W8). If the result of decision indicates that an entry indicatingthe IP address Nc is present, on the other hand, the process does notcreate a link entry. Instead, the process updates the minimum networkaddress mask length to the mask length Mn (step W9). Then, the processreturns to step W3.

[0085] If the result of decision indicates that the mask length Mn isnot present, on the other hand, the process searches for a cache entryindicating the IP address Nc (step W10).

[0086] Next, the process decides whether a cache entry indicating the IPaddress Nc is present (step W11).

[0087] If a result of decision indicates that the cache entry is notpresent, the process creates a final cache entry that stores informationnecessary to perform routing such as output interfacing or next hopping(step W12). Then, the process ends processing.

[0088] If the result of decision indicates that the cache entry ispresent, on the other hand, the process ends the processing withoutcreating the final cache entry.

[0089]FIGS. 7 and 8 are flowcharts for showing operations of the cachemanagement section 3 of FIG. 1.

[0090] A routing table management-processing section 31 detects avariation in a routing table by either using a typical routing protocolor changing settings to the device and outputs to a cachemanagement-processing section 32 information of addition of a routingentry to or deletion thereof from the routing table.

[0091] Based on the information output from the routing tablemanagement-processing section 31, the cache management-processingsection 32 alters or deletes the cache entries in the cache memory 12.

[0092] When an routing entry is added, first the process takes out anetwork address mask length Ma of a network address Na of the addedrouting entry (step A1 of FIG. 4).

[0093] Further, the process searches for a cache entry Np having amaximum mask length of the cache entries containing the added networkaddress Na (step A2). The process then decides whether the cache entryNp is found (step A3).

[0094] If the cache entry Np is found as a result of decision at stepS3, the process decides whether the cache entry Np indicates linkprocessing (step A4).

[0095] If a result of decision at step A4 indicates that the cache entryNp indicates link processing, the process decides whether a next networkaddress mask length used in the link processing indicated by the cacheentry Np is smaller than the added network address mask length Ma (stepA5).

[0096] If a result of decision at step A4 indicates that the cache entryNp does not indicate link processing or if a result of decision at stepA5 indicates that the next network address mask length used in the linkprocessing indicated by the cache entry Np is larger than the addednetwork address mask length Ma, the process updates a next networkaddress mask length used in the link processing in the cache entry Np tothe network address mask length Ma, thereby ending the processing (stepA6).

[0097] If the result of decision at step A5 indicates that the nextnetwork address mask length used in the link processing indicated by thecache entry Np is not larger than the added network address mask lengthMa, the process ends processing shown in FIG. 4.

[0098] If the cache entry is not found at step A3, the process decideswhether the minimum network address mask length Mm is less than thenetwork address mask length Ma of the added routing entry (step A7).

[0099] If a result of decision at step A7 indicates that the minimumnetwork address mask length Mm is less than the network address masklength Ma of the added routing entry, the process updates the minimumnetwork address mask length Mm to the network address mask length Ma ofthe added routing entry (step A8).

[0100] If the minimum network address mask length Mm is not less thanthe network address mask length Ma of the added routing entry, theprocess ends the processing shown in FIG. 4.

[0101] If a routing entry is deleted, first the process takes out anetwork address mask length Md of a network address Nd of the deletedrouting entry (step D1 of FIG. 5).

[0102] Next, the process searches for the cache entry Np having themaximum length of the cache entries containing the deleted networkaddress Nd (step D2). Then, the process decides whether the cache entryNp is found (step D3).

[0103] If the cache entry Np, which indicates link processing, is foundat step D3, the process decides whether a next network address masklength used in the link processing indicated by the cache entry Np issmaller than the deleted network address mask length Md (step D4).

[0104] If a result of decision at step D4 indicates that the nextnetwork address mask length used in the link processing is not less thanthe deleted network address mask length Md, the process searches for anyother routing entry having the same mask length as the deleted networkaddress mask length Md from the routing entries containing the deletednetwork address Nd (step D5).

[0105] If a result of decision at step D5 indicates that no otherrouting entry is present, the cache entry Np is deleted (step D6). Ifthe result of decision at step D4 indicates that the next networkaddress mask length used in the link processing is smaller than thedeleted network address mask length Md or that the result of decision atstep D5 indicates that any other routing entry is present, the processends processing shown in FIG. 5.

[0106] If the cache entry Np is not found at step D3, the processdecides whether the minimum network address mask length Mm is thenetwork address mask length Md of the deleted routing entry (step D7).

[0107] If a result of decision at step D7 indicates that the minimumnetwork address mask length Mm is the network address mask length Md ofthe deleted routing entry, the process searches for any other routingentry having the same mask length as the deleted network address masklength Md from the routing entries containing the deleted networkaddress Nd (step D8).

[0108] If no other routing entry is found at step D8, the processupdates the minimum network address mask length Mm to a mask length of arouting entry having the minimum mask length (step D9).

[0109] If the result of decision at step D7 indicates that the minimumnetwork address mask length Mm is not the network address mask length Mdof the deleted routing entry or any other routing entry is found at stepD8, the process ends the processing shown in FIG. 5.

[0110] The cache monitoring timer processing section 33 monitors therouting entry storage cache memory 12, to delete a cache entry that hasnot been used for at least a constant time.

[0111] In the embodiment of the present invention, either dedicatedhardware for high-speed retrieval may be provided or an equivalent logicmay be constituted of software.

[0112] As described above, by the present invention, since only routingentries in a utilized routing table are cached, it is possible is toreduce a capacity of a cache memory for storing the entries and alsoreduce a size of a retrieval engine itself because the cache memorysubject to retrieval is thus reduced in size.

[0113] Therefore, the cache memory can be reduced in capacity, therebyreducing a product cost. Further, a reduction in capacity of the cachememory makes it possible to improve a retrieval throughput.

What is claimed is:
 1. A router device for routing a packet based on itsdestination address, comprising: a routing table for storing routingentries including routing information relating the destination addressof the packet to a routing path; a cache memory for storing some ofrouting entries in the routing table together with mask-lengthinformation of the destination address as a cache entry; a firstretrieval section for retrieving the cache entry which corresponds tothe destination address of the packet by making reference to the cachememory based on the destination address; a second retrieval section forretrieving the routing entry which corresponds to the destinationaddress by making reference to the routing table; a storage section forstoring the routing entry retrieved by the second retrieval sectiontogether with the mask-length information of the destination address asthe cache entry in the cache memory; and an output section foroutputting a retrieval result sent from the first or second retrievalsection.
 2. The router device according to claim 1, wherein: the firstretrieval section retrieves the cache memory before the second retrievalsection retrieves the routing table; and the second retrieval sectionretrieves the routing entry if the cache entry corresponding to thedestination address is not present in the cache memory.
 3. The routerdevice according to claim 1, wherein the first retrieval sectioncomprises: a take-out section for taking out the destination address ofthe input packet; an extraction section for extracting a mask length ofnetwork address in the routing table; a creation section for creating anaddress by an AND operation between the destination address and aminimum mask length among the mask lengths; a search section forsearching the cache memory for the cache entry by regarding the createdaddress to be a virtual network address; a decision section for decidingwhether the cache entry is a link entry comprising an entry group towhich the cache entry relates, if the cache entry is searched; and aprompting section for prompting the extraction section to take out themask length larger than the mask length extracted earlier, until thedecision section decides which the cache entry once decided to be thelink entry is not the link entry.
 4. The router device according toclaim 1, wherein the second retrieval section comprises: a take-outsection for taking out the destination address of the input packet; anextraction section for extracting a mask length of a network addressfrom the routing table; a first creation section for creating an addressby an AND operation between the destination address and the mask length;a first search section for searching the routing table for the routingentry which indicates the created address; a second search section forsearching the routing table for a minimum mask length among the masklengths larger than the mask length extracted earlier by the extractionsection, from a routing entry group contained in the created address; asecond creation section for creating a link entry if the routing entryis not present and the minimum mask length is present by the searchedresults; a prompting section for prompting the extraction section totake out the mask length larger than the mask length extracted earlierafter the link entry is created if the routing entry and the minimumnetwork address mask length are present by the searched results; and athird creation section for creating a final cache entry that storesinformation necessary for routing if neither the routing entry nor theminimum network address mask length is present by the searched results.5. The router device according to claims 1, further comprising a cachemanagement section for managing states of the cache memory and therouting table.
 6. The router device according to claim 5, wherein thecache management section comprises: a take-out section for taking out amask length of a network address of the routing entry if the routingentry is added to the routing table; a search section for searching forthe cache entry having a maximum mask length of the cache entriescontaining the network address; a first decision section for decidingwhether the cache entry indicates link processing if the cache entryhaving the maximum mask length is found by the searched results; asecond decision section for deciding whether a next mask length of thenetwork address used in the link processing indicated by the cache entryis smaller than an added mask length, if the cache entry indicates linkprocessing by a result of decision by the first decision section; afirst update section for updating the mask length to the next masklength used in the link processing in the cache entry, if the cacheentry does not indicate the link processing as a result of decision bythe first decision section, or if the next mask length used in the linkprocessing indicated by the cache entry is larger than the added masklength as a result of decision by the second decision section; a thirddecision section for deciding whether the minimum mask length is lessthan the mask length of the added routing entry, if the cache entry isnot found as a result of search by the search section; and a secondupdate section for updating the minimum mask length to the mask lengthof the added routing entry, if the minimum mask length is less than themask length of the added routing entry as a result of decision by thethird decision section.
 7. The router device according to claim 5,wherein the cache management section comprises: a second take-outsection for taking out the mask length of the network address of therouting entry if the routing entry is deleted from the routing table; asecond search section for searching for the cache entry having a maximummask length from the cache entries containing the network address; athird decision section for deciding whether a next mask length of thenetwork address used in link processing indicated by the cache entry issmaller than a mask length of a network address of deleted routingentry, if the cache entry is found as a result of search by the secondsearch section; a third search section for searching for any otherrouting entry having the same mask length as the deleted network addressmask length from the routing entries containing a deleted networkaddress, if the next mask length used in the link processing is largerthan the deleted mask length as a result of decision by the thirddecision section; a deletion section for deleting the cache entrysearched by the second search section, if the other routing entry is notpresent as a result of searching by the third search section; a fourthdecision section for deciding whether the minimum mask length is themask length of the deleted routing entry, if the cache entry is notfound by as a result of searching by the second search section; a thirdsearch section for searching for any other routing entry having the samemask length as the deleted mask length from the routing entriescontaining the deleted network address, if the minimum mask length isthe mask length of the deleted routing entry as a result of decision bythe fourth decision section; and a third update section for updating theminimum mask length to the mask length of the routing entry having theminimum mask length of the routing entries in the routing table, if theother routing entry is not found as a result of search by the thirdsearch section.
 8. The router device according to claim 5, wherein thecache management section monitors the cache memory and deletes the cacheentry that has not been used for at least a constant time.
 9. A routingmethod of routing a packet based on its destination address, comprisingthe steps of: storing routing entries including routing informationrelating the destination address of the packet to a routing path in arouting table; storing some of routing entries in the routing tabletogether with mask-length information of the destination address as acache entry in a cache memory; firstly retrieving the cache entry whichcorresponds to the destination address of the packet by making referenceto the cache memory based on the destination address; secondlyretrieving the routing entry which corresponds to the destinationaddress by making reference to the routing table; storing the routingentry retrieved by the second retrieval section together with themask-length information of the destination address as the cache entry inthe cache memory; and outputting a retrieval result sent from the firstor second retrieval section.
 10. The routing method according to claim9, wherein: the firstly retrieving step retrieves the cache memorybefore the second retrieval section retrieves the routing table; and thesecondly retrieving step retrieves the routing entry if the cache entrycorresponding to the destination address is not present in the cachememory.
 11. The routing method according to claim 9, wherein the firstlyretrieving step comprises the steps: taking out the destination addressof the input packet; extracting a mask length of network address in therouting table; creating an address by an AND operation between thedestination address and a minimum mask length among the mask lengths;searching the cache memory for the cache entry by regarding the createdaddress to be a virtual network address; deciding whether the cacheentry is a link entry comprising an entry group to which the cache entryrelates, if the cache entry is searched; and prompting the extractionstep to take out the mask length larger than the mask length extractedearlier, until the decision step decides that the cache entry oncedecided to be the link entry is not the link entry.
 12. The routingmethod according to claim 9, wherein the secondly retrieving stepcomprises the steps: taking out the destination address of the inputpacket; extracting a mask length of a network address from the routingtable; creating an address by an AND operation between the destinationaddress and the mask length; searching the routing table for the routingentry that indicates the created address; searching the routing tablefor a minimum mask length among the mask lengths larger than the masklength extracted earlier by the extraction step, from a routing entrygroup contained in the created address; creating a link entry if therouting entry is not present and the minimum mask length is present bythe searched results; prompting the extraction section to take out themask length larger than the mask length extracted earlier after the linkentry is created if the routing entry and the minimum network addressmask length are present by the searched results; and creating a finalcache entry that stores information necessary for routing if neither therouting entry nor the minimum network address mask length is present bythe searched results.
 13. The routing method according to claims 9,further comprising a step of managing states of the cache memory and therouting table.
 14. The routing method according to claim 13, wherein themanaging step comprises the steps of: taking out a mask length of anetwork address of the routing entry if the routing entry is added tothe routing table; searching for the cache entry having a maximum masklength of the cache entries containing the network address; decidingwhether the cache entry indicates link processing if the cache entryhaving the maximum mask length is found by the searched results;deciding whether a next mask length of the network address used in thelink processing indicated by the cache entry is smaller than an addedmask length, if the cache entry indicates link processing by a result ofdecision by the first decision section; updating the mask length to thenext mask length used in the link processing in the cache entry, if thecache entry does not indicate the link processing as the result ofdecision, or if the next mask length used in the link processingindicated by the cache entry is larger than the added mask length as theresult of decision; deciding whether the minimum mask length is lessthan the mask length of the added routing entry, if the cache entry isnot found as the result of the searching step; and updating the minimummask length to the mask length of the added routing entry, if theminimum mask length is less than the mask length of the added routingentry as the result of decision.
 15. The routing method according toclaim 13, wherein the managing step comprises the steps of: taking outthe mask length of the network address of the routing entry if therouting entry is deleted from the routing table; searching for the cacheentry having a maximum mask length from the cache entries containing thenetwork address; deciding whether a next mask length of the networkaddress used in link processing indicated by the cache entry is smallerthan a mask length of a network address of deleted routing entry, if thecache entry is found as the result of search; searching for any otherrouting entry having the same mask length as the deleted network addressmask length from the routing entries containing a deleted networkaddress, if the next mask length used in the link processing is largerthan the deleted mask length as the result of decision; deleting thesearched cache entry, if the other routing entry is not present as theresult of search; deciding whether the minimum mask length is the masklength of the deleted routing entry, if the cache entry is not found byas the result of search; searching for any other routing entry havingthe same mask length as the deleted mask length from the routing entriescontaining the deleted network address, if the minimum mask length isthe mask length of the deleted routing entry as the result of decision;and updating the minimum mask length to the mask length of the routingentry having the minimum mask length of the routing entries in therouting table, if the other routing entry is not found as the result ofsearch.
 16. The routing method according to claim 13, wherein themanaging step comprises the steps of: monitoring the cache memory; anddeleting the cache entry that has not been used for at least a constanttime.